Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allows for props to dynamically update animate-able data #1

Closed
wants to merge 5 commits into from

Conversation

sankho
Copy link
Contributor

@sankho sankho commented Jun 24, 2016

using this on a project I'm working on

  • saves the d3 datamap in memory to the react component class so it can be re-used if needed
  • allows for prop changes on bubbles or data to be animated
  • adds prop for reset option on data updates using updateChloropeth
  • redraws map on height or width changes as these can't be done w/n the existing datamap

@sankho sankho changed the title allows for props to dynamically updates animate-able data allows for props to dynamically update animate-able data Jun 24, 2016
@btmills btmills mentioned this pull request Jun 28, 2016
@btmills
Copy link
Owner

btmills commented Jun 28, 2016

@sankho thanks for this! I was able to take what you did here and combine it with a rewrite of the examples in #2 so that I can demonstrate parity with the examples at https://datamaps.github.io. Can you check out the src/datamaps.jsx changes in #2 and let me know what you think?

I didn't include the resetOnUpdateChoropleth option in #2 yet. What does the reset option do there?

@sankho
Copy link
Contributor Author

sankho commented Jun 30, 2016

@btmills the update branch looks great, like the transition to using the ES6 class approach as opposed to the old ES5 approach.

resetOnUpdateChoropleth, or as you say the reset option on the datamaps' updateChoropleth method - resets the map of all data when you call updateChoropleth. So if it's set to true, the updating data will overwrite the previous dataset, where if it's set to false, it will be additive / merged in w/ the old dataset.

Would love to build on top ofyour changes - I pushed a few more changes to my branch to deal with a few bugs I caused but it's all in the old React component form, would like to move on to the latest. LMK if you merge it in and I can make another PR!

@btmills
Copy link
Owner

btmills commented Jul 1, 2016

@sankho thanks for the explanation! I added an updateChoroplethOptions prop in 4b6acf3. The datamaps v0.4.4 release notes said reset is the only key it cares about now, but having users pass in updateChoroplethOptions={{ reset: true }} makes it forward-compatible without any updates here if there are other options added later.

I just merged #2, so you should be good to start building on top of it (and sorry about the merge conflicts 😳 ).

@sankho
Copy link
Contributor Author

sankho commented Jul 1, 2016

@btmills actually the changes you made in #2 satisfy my needs. Gonna move onto solving issue #3 next.

Examples page looks great btw!

@sankho sankho closed this Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants